from typing import Generic, TypeVar

from chernc.treediff.gumtree.tree.tree import TreeLike


T = TypeVar("T", bound="TreeLike")  # 泛型类型 T，表示树的节点类型


class Mapping(Generic[T]):
    def __init__(self, src: T, dst: T) -> None:
        """
        :param src: The source node in the mapping.
        :param dst: The destination node in the mapping.
        """
        self.src: T = src
        self.dst: T = dst

    def __repr__(self) -> str:
        return f"Mapping(src={self.src}, dst={self.dst})"

